package top.lucky.utils;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

/**
 * @author Jane
 * @date 2022/11/16, 11:03
 */
public class FileUtil {
	public static String getFileDocs() {
		
		String str = "";
		File file = new File("/Users/miao_jy/Downloads/未命名.txt");
		try {
			FileInputStream in = new FileInputStream(file);
			// size 为字串的长度 ，这里一次性读完
			int size = in.available();
			byte[] buffer = new byte[size];
			in.read(buffer);
			in.close();
			str = new String(buffer, "GB2312");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			return null;
		}
		return str;
	}
}
